package me.innolux.daxin_nesting.Service.impl;

import lombok.RequiredArgsConstructor;
import me.innolux.daxin_nesting.Service.WcsService;
import me.innolux.daxin_nesting.pojo.entity.MiddleTable;
import me.innolux.daxin_nesting.pojo.vo.WcsReturnVo;
import me.innolux.daxin_nesting.sqlService.MiddleTableService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class WcsServiceImpl implements WcsService {
    private final MiddleTableService middleTableService;
    @Override
    public WcsReturnVo middle(String containerCode) {
        //通过载具码查询信息，返回WCS
        List<MiddleTable> middleTableList = middleTableService.selectContainerCode(containerCode);
        if (!middleTableList.isEmpty()){
            return WcsReturnVo.OK(middleTableList);
        }
        return WcsReturnVo.ng("未查询到栈板码信息");
    }
}
